<template>
  
  <div :class="$style.footer">
    <div class="btn" >
      <img @click="consultationHandle" src="./../assets/dhzx.png" />
    </div>
    <div >
      <img @click="onLineSignUpHandle" src="./../assets/zxzx.png" />
    </div>
    <div >
      <img @click="backIndexHandle" src="./../assets/wxzx.png" />
    </div>
    <div class="window" v-show="showWindow" style="text-align: center;z-index:0;background-color: #48433a;width:130px;height:70%;position: absolute;right:7px;bottom:46px;border-radius:25px 25px 25px 25px;">
      <div style="width:100%;height:100%;position: absolute;top:0;padding-top:5px;">
        <p >加微信</p>
        <p style="color:red;"><b>123123</b></p>
        <p >如不能复制</p>
        <p >请手动添加</p>
        <p style="color:red;" class="copyBtn"  data-clipboard-text="123123"  @click="copyText"><b>点击我复制</b></p>
      </div>
    </div>
  </div>
</template>

<script>
import Clipboard from 'clipboard'
export default {
  data() {
    return{
      showWindow:false
    }
  },
  setup() {
    
    // return { consultationHandle, onLineSignUpHandle, backIndexHandle };
  },
  methods:{
    copyText(){
      console.log(12)
      var clipboard = new Clipboard('.copyBtn')
        clipboard.on('success', e => {
          alert('复制成功')
          // 释放内存
          clipboard.destroy()
        })
        clipboard.on('error', e => {
          // 不支持复制
          alert('该浏览器不支持自动复制')
          // 释放内存
          clipboard.destroy()
        })
    },
    consultationHandle () {
      alert("咨询");
    },
    onLineSignUpHandle () {
      alert("报名");
    },
    backIndexHandle() {
      // ref="about"
      // alert("返回首页");
      this.showWindow = !this.showWindow
    }
  }
};
</script>
<style lang="scss" module>
@import url("./../common/util.scss");
.footer {
  height: 200px;
  display: flex;
  overflow: hidden;
  box-sizing: border-box;
  position: fixed;
  bottom: 0;
  z-index: 2;
  padding-top: 158px;
  div  {
    width: 50%;
    height: 42px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  p {
    color: #ffff;
    font-size: 12px;
    line-height: 13px;
  }
}

</style>
